import * as path from 'path';
import { setSharedProperty } from '.';
import { IFileSystem } from '../common/platform/types';
import { EXTENSION_ROOT_DIR } from '../constants';

export async function setExtensionInstallTelemetryProperties(fs: IFileSystem): Promise<void> {

    const fileToCheck = path.join(path.dirname(EXTENSION_ROOT_DIR), 'eqCodingPack');
    console.log(fileToCheck);
    if (await fs.fileExists(fileToCheck)) {
        setSharedProperty('installSource', 'eqCodingPack');
    } else {
        // We did not file the `EQCodingPack` file, assume market place install.
        setSharedProperty('installSource', 'marketPlace');
    }
}